import request from '@/utils/request'

export function sensor_data_list(sensor_id, start, end, page = 1) {
  return request({
    url: `/admin/sensor_data_list?start=${start}&end=${end}&page=${page}&sensor_id=${sensor_id}`,
    method: 'get'
  })
}
export function sensor_data_edit(data) {
  return request({
    url: '/admin/sensor_edit',
    method: 'post',
    data
  })
}

export function sensor_delete(data) {
  return request({
    url: `/admin/sensor_delete/${data.id}`,
    method: 'delete',
    data
  })
}

export function sensor_data_last(sensor_id) {
  return request({
    url: `/admin/sensor_data_last?sensor_id=${sensor_id}`,
    method: 'get'
  })
}

export function download_excel(data) {
  return request({
    url: `/admin/download_excel`,
    method: 'post',
    data
  })
}

export function batch_add_sensor_data(data) {
  return request({
    url: `/admin/batch_add_sensor_data`,
    method: 'post',
    data
  })
}
